package cn.sofwin.day0201.homework;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class t2 {
    public static void main(String[] args) {
       String str = "goOd gooD stUdy dAy dAy up";
       char[] c = str.toCharArray();


       if(c[0] > 96){
           c[0] = (char)(c[0] - 32);
       }

        for (int i = 1; i < c.length; i++) {
            if(c[i - 1] == ' '){
                if(c[i] > 96){
                    c[i] = (char)(c[i] - 32);
                }
            }else {
                if(c[i] < 91){
                    c[i] = (char)(c[i] + 32);
                }
            }
        }




        System.out.println(c);
    }
}
